package com.sky.mapper.user;

import com.sky.pojo.Setmeal;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserSetmealMapper {

    /**
     * 根据分类id查询套餐
     * */
    @Select("select * from setmeal where category_id=#{categoryId} and status=1")
    List<Setmeal> selectSetmeal(Integer categoryId);


    /**
     * 根据套餐id查询包含的菜品
     * */
    @Select("select s.name name,s.copies copies,d.image image,d.description description from setmeal_dish s join  dish d on s.dish_id=d.id where setmeal_id=#{setmealld}")
    List<DishItemVO> selectDishItemVO(Integer setmealld);


}
